]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-theme-node-drawing: Render all shadow sections with thickness > 0
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Wed, 19 Aug 2020 11:22:51 +0000 (19:22 +0800)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 1 Dec 2020 23:01:30 +0000 (00:01 +0100)
In some styles the top or left sections of box-shadows would go missing
even though they had non-zero thickness. This was because the inner
local coordinates could become very slightly negative and were then
incorrectly judged to be invisible.

Negative coordinates should not be ignored because that's where the
entire top/left sections of shadow are meant to exist. It's only the
sections of shadow with zero thickness that we should skip.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1417>

src/st/st-theme-node-drawing.c

index 1e00a06f3739df8d3043019245029072d62fb142..64f2d75184a838cb194eff8e8fa9b32443eab15e 100644 (file)
@@ -2103,9 +2103,9 @@ st_theme_node_paint_sliced_shadow (StThemeNodePaintState *state,
 
   idx = 0;
 
-  if (top > 0)
+  if (yoffset < top)
     {
-      if (left > 0)
+      if (xoffset < left)
         {
           /* Top left corner */
           rectangles[idx++] = xoffset;
@@ -2130,7 +2130,7 @@ st_theme_node_paint_sliced_shadow (StThemeNodePaintState *state,
       rectangles[idx++] = s_right;
       rectangles[idx++] = s_top;
 
-      if (right > 0)
+      if (xend > right)
         {
           /* Top right corner */
           rectangles[idx++] = right;
@@ -2145,7 +2145,7 @@ st_theme_node_paint_sliced_shadow (StThemeNodePaintState *state,
         }
     }
 
-  if (left > 0)
+  if (xoffset < left)
     {
       /* Left middle */
       rectangles[idx++] = xoffset;
@@ -2170,8 +2170,7 @@ st_theme_node_paint_sliced_shadow (StThemeNodePaintState *state,
   rectangles[idx++] = s_right;
   rectangles[idx++] = s_bottom;
 
-
-  if (right > 0)
+  if (xend > right)
     {
       /* Right middle */
       rectangles[idx++] = right;
@@ -2185,9 +2184,9 @@ st_theme_node_paint_sliced_shadow (StThemeNodePaintState *state,
       rectangles[idx++] = s_bottom;
     }
 
-  if (bottom > 0)
+  if (yend > bottom)
     {
-      if (left > 0)
+      if (xoffset < left)
         {
           /* Bottom left corner */
           rectangles[idx++] = xoffset;
@@ -2212,7 +2211,7 @@ st_theme_node_paint_sliced_shadow (StThemeNodePaintState *state,
       rectangles[idx++] = s_right;
       rectangles[idx++] = 1;
 
-      if (right > 0)
+      if (xend > right)
         {
           /* Bottom right corner */
           rectangles[idx++] = right;